package com.genius.system.bo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@ApiModel(value = "修改角色信息BO", description = "从客户端，由用户传入的数据封装在此entity中")
public class UpdateRoleBO {

    @NotNull(message = "角色ID不能为空")
    @ApiModelProperty(value = "角色ID")
    private Long roleId;

    @NotBlank(message = "角色名称不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9fa5]{2,10}", message = "roleName内容不正确")
    @ApiModelProperty(value = "角色名称")
    private String roleName;

    @Length(max = 20, message = "备注不能超过20个字符")
    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty("菜单列表")
    private Long[] menuIds;

    @NotBlank(message = "数据范围不能为空")
    @Pattern(regexp = "^1$|^2$|^3$|^4$|^5$", message = "数据范围不正确")
    @ApiModelProperty("数据范围（1全部数据权限，2自定义数据权限，3本下级数据权限，4仅本级数据权限，5仅本人数据权限）")
    private String dataAuth;

    @ApiModelProperty("数据权限列表")
    private Long[] deptIds;
}
